<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            font-family: '黑体';
        }
    </style>
</head>
<body>
    <script>
        for(var i=0;i<4;i++){
            for(var j=0;j<i;j++){
                document.write('&nbsp;');
            }
            for(var j=4;j>i;j--){
                document.write('*');
            }
            document.write('<br />');
        }
        for(var i=0;i<3;i++){
            for(var j=2;j>i;j--){
                document.write('&nbsp;');
            }
            for(var j=0;j<i+2;j++){
                document.write('*');
            }
            document.write('<br />');
        }
    </script>
</body>
</html>